package com.kantboot.business.talent.repository;

import com.kantboot.business.talent.domain.entity.BusTalentExpertLevelExperienceOfUserAccount;
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface BusTalentExpertLevelExperienceOfUserAccountRepository extends JpaRepository<BusTalentExpertLevelExperienceOfUserAccount,Long> {

    /**
     * 根据用户id删除
     */
    @Transactional
    @Modifying
    @Query("delete from BusTalentExpertLevelExperienceOfUserAccount where userAccountId=?1")
    void deleteByUserAccountId(Long userAccountId);

    /**
     * 删除专家人才等级经历中专家人才等级id为空的记录
     */
    @Transactional
    @Modifying
    @Query("delete from BusTalentExpertLevelExperienceOfUserAccount where expertLevelId is null")
    void deleteByExpertLevelIdIsNull();


}
